const setToken = (value: string) => {
  return {
    type: "SET_TOKEN",
    payload: value,
  };
};

const cleanToken = () => {
  return {
    type: "CLEAN_TOKEN",
    payload: null,
  };
};

const setPermissions = (value: string[]) => {
  return {
    type: "SET_PERMISSIONS",
    payload: value,
  };
};

const cleanPermissions = () => {
  return {
    type: "CLEAN_PERMISSIONS",
    payload: [],
  };
};

const setUserInfo = (value: UserInfoType) => {
  return {
    type: "SET_USER_INFO",
    payload: value,
  };
};

const cleanUserInfo = () => {
  return {
    type: "CLEAN_USER_INFO",
    payload: {},
  };
};

const setTitle = (value: any) => {
  return {
    type: "SET_TITLE",
    payload: value,
  };
};

export {
  setToken,
  cleanToken,
  setPermissions,
  cleanPermissions,
  setUserInfo,
  cleanUserInfo,
  setTitle
};
